﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SmartMathLibrary.Generator
{
    /// <summary>
    /// A specialization of the AbstractGenerator for functions, which includes one parameter.
    /// </summary>
    [Serializable]
    public abstract class AbstractOneParameterFunctionGenerator : AbstractGenerator
    {
        /// <summary>
        /// The internal interval of the function generator.
        /// </summary>
        private double interval;

        /// <summary>
        /// Initializes a new instance of the <see cref="AbstractOneParameterFunctionGenerator"/> class.
        /// </summary>
        /// <param name="interval">The interval of the function generator.</param>
        protected AbstractOneParameterFunctionGenerator(double interval)
            : base()
        {
            this.interval = interval;
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="AbstractOneParameterFunctionGenerator"/> class.
        /// </summary>
        /// <param name="interval">The interval of the function generator.</param>
        /// <param name="startvalue">The start value of the function generator.</param>
        protected AbstractOneParameterFunctionGenerator(double interval, double startvalue)
            : base(startvalue)
        {
            this.interval = interval;
        }

        /// <summary>
        /// Gets or sets the interval of the generator.
        /// </summary>
        /// <value>The interval of the generator.</value>
        public double Interval
        {
            get { return interval; }
            set { interval = value; }
        }

        /// <summary>
        /// Gets the current base of the generator.
        /// </summary>
        /// <value>The current base of the generator.</value>
        public double CurrentGeneratorBase
        {
            get { return currentValue; }
        }
    }
}